home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Add-Ons / MPW / MPW noweb 2.7 / src / xdoc / manpage.nw < prev    next >
Encoding:
Text File  |  1995-05-30  |  13.8 KB  |  520 lines  |  [TEXT/MPS ]

  1. <<notangle.1>>=
  2. .TH NOWEB 1 "local <<noweb documentation date>>"
  3. .SH NAME
  4. notangle, noweave, nountangle \- noweb, a literate-programming tool
  5. .SH SYNOPSIS
  6. .B notangle
  7. [\fB-R\fProotname] [\fB-filter\fP command]
  8. [\fB-L\fP[format]] [file] ...
  9. .br
  10. \fBnountangle\fP 
  11. [\fB-ml\fP|\fB-m3\fP|\fB-c\fP|\fB-c++\fP|\fB-awk\fP|\fB-tex\fP|\fB-f77\fP|\fB-f90\fP]
  12. [\fB-R\fProotname] [\fB-filter\fP command] [\fB-w\fPwidth] [file] ...
  13. .br
  14. \fBnoweave\fP [options] [file] ...
  15. .SH DESCRIPTION
  16. .I Noweb
  17. is a literate-programming tool like Knuth's
  18. .I WEB,
  19. only simpler.
  20. .I noweb
  21. file contains program source code interleaved with documentation.
  22. When 
  23. .I notangle
  24. is given a 
  25. .I noweb
  26. file, it writes the program on standard output.
  27. When 
  28. .I noweave
  29. is given a 
  30. .I noweb
  31. file, it reads the 
  32. .I noweb
  33. source and produces, on standard output, \fILaTeX\fP, \fITeX\fP, or \fIHTML\fP
  34. source for typeset documentation.
  35. .I nountangle
  36. converts a literate program into an ordinary program by
  37. turning interleaved documentation into comments.
  38. The file name `-' refers to standard input.
  39. .SH FORMAT OF NOWEB FILES
  40. <<paragraph describing markup of chunks>>
  41. <<paragraph describing markup of chunks>>=
  42. .I noweb 
  43. file is a sequence of
  44. .I chunks,
  45. which may appear in any order.
  46. A chunk may contain code or documentation.
  47. Documentation chunks begin with a line that starts with an at sign (@) 
  48. followed by a space or newline.
  49. They have no names.
  50. Code chunks begin with
  51. .br
  52. @<<\fIchunk name\fP@>>=
  53. .br
  54. on a line by itself.
  55. The double left angle bracket (@<<) must be in the first column.
  56. Chunks are terminated by the beginning of another chunk, or by end of file.
  57. If the first line in the file does not mark the beginning of a
  58. chunk, it is assumed to be the first line of a documentation chunk.
  59. @
  60. <<notangle.1>>=
  61. .PP
  62. Documentation chunks contain text that is ignored by
  63. .I notangle
  64. and copied verbatim to 
  65. standard output
  66. by
  67. .I noweave
  68. (except for quoted code).
  69. .I noweave
  70. can work with \fILaTeX\fP, plain \fITeX\fP, or \fIHTML\fP.
  71. With plain \fITeX\fP, it inserts a reference to a 
  72. .I TeX
  73. macro package, \fInwmac\fP, which defines commands like
  74. .B \echapter
  75. and
  76. .B \esection.
  77. .PP
  78. Code chunks contain program source code and references to other code
  79. chunks.
  80. Several code chunks may have the same name;
  81. .I notangle
  82. concatenates their definitions to produce a single chunk, just as does
  83. .I tangle(1).
  84. Code chunk definitions are like macro definitions;
  85. .I notangle
  86. extracts a program by expanding one chunk (by default, the chunk named
  87. \fB@<<\fP*\fB@>>\fP).
  88. The definition of that chunk contains references to other chunks, which are 
  89. themselves expanded, and so on.
  90. \fInotangle\fP's output is readable; it preserves the indentation of expanded
  91. chunks with respect to the chunks in which they appear.
  92. .PP
  93. Code may be quoted within documentation
  94. chunks by placing double square brackets
  95. (\fB[[\fI...\fB]]\fR) around it.
  96. These double square brackets are ignored by
  97. .I notangle,
  98. but they may be used by 
  99. .I noweave
  100. to give the code special typographic treatment, e.g., hypertext links.
  101. If quoted code ends with three or more square brackets,
  102. .I noweave
  103. choose the rightmost pair, so that, for example, \fB[[a[i]]]\fR is
  104. parsed correctly.
  105. .PP
  106. <<paragraph on escaping angle brackets>>
  107. <<paragraph on escaping angle brackets>>=
  108. If double left and right angle brackets are not paired, they are
  109. treated as literal \fB@<<\fP and \fB@>>\fP.  Users can force any
  110. such brackets, even paired brackets, to be treated as literal by
  111. using a preceding at sign (e.g. \fB@@<<\fP).
  112. <<old paragraph on escaping angle brackets>>=
  113. If the double left or right angle bracket is to be used 
  114. in code or documentation,
  115. not as part of a chunk name, it should be preceded by an at sign
  116. (e.g. \fB@@<<\fP), although the at sign is not required in code if there is no 
  117. matching double bracket.
  118. <<notangle.1>>=
  119. .PP
  120. <<paragraph on marking identifier definitions>>
  121. <<paragraph on marking identifier definitions>>=
  122. Any line beginning with `\fB@ \fP' terminates a code chunk,
  123. but if the line has the form
  124. .br
  125. \fB@ %def \fP\fIidentifiers\fP
  126. .br
  127. it is taken to mean that the preceding chunk defines the identifiers listed 
  128. in 
  129. .I identifiers.
  130. This list contains identifiers separated by whitespace; 
  131. any sequence of nonwhite characters may be an identifier.
  132. .I noweb
  133. uses a simple heuristic to avoid recognizing identifiers 
  134. that are substrings of other identifiers.
  135. <<notangle.1>>=
  136. .SH TANGLING
  137. .I notangle
  138. and
  139. .I nountangle
  140. accept the same set of options, although some options have effects only on one 
  141. or the other.
  142. The options are:
  143. .TP
  144. .B -R\fIname\fR
  145. Expand the \fB@<<\fIname\fB@>>\fR code chunk instead of \fB@<<\fP*\fB@>>\fP.
  146. .TP
  147. .B -L\fIformat\fR
  148. Emit line number indications at chunk boundaries.
  149. A line number indication identifies the source of the line that follows it.
  150. In
  151. .I format,
  152. .B "%F"
  153. indicates the name of the source file,
  154. .B "%L"
  155. indicates the line number of the source file,
  156. .B "%N"
  157. indicates a newline,
  158. and 
  159. .B "%%"
  160. indicates a percent sign.
  161. A sign and digit may be inserted between the percent sign and the `\fBL\fP',
  162. in which case the line number will be adjusted by that amount.
  163. If 
  164. .I format
  165. is omitted, the default format is that accepted by the C preprocessor:
  166. `\fB#line %L "%F"%N\fR'.
  167. When using the \fB-L\fIformat\fR option, 
  168. .I notangle
  169. ensures that all text appears in the same column in input and output.
  170. .I nountangle
  171. ignores this option.
  172. .TP
  173. .B \-t\fIk\fP
  174. Copy tabs untouched from input to output, and use tabs for indentation, 
  175. assuming stops every \fIk\fP columns.
  176. By default, tabs are expanded to spaces with stops every 8 columns.
  177. .TP
  178. .B \-filter \fIcmd\fP
  179. Filter the 
  180. .I noweb
  181. source through 
  182. .I cmd
  183. after converting it to tool form and before tangling.
  184. .I notangle
  185. looks for 
  186. .I cmd
  187. first on the user's
  188. .B PATH,
  189. then in
  190. .B |LIBDIR|.
  191. Such filters
  192. can be used to add features to
  193. .I notangle;
  194. for an example see
  195. .B |LIBDIR|/emptydefn.
  196. For experts only.
  197. <<description of -markup option>>
  198. .TP
  199. .B "-awk | -c | -icn | -icon | -ml | -m3 | -pascal | -f77 | -f90 | -tex"
  200. When 
  201. .I nountangle
  202. transforms documentation chunks into comments, use the comment format of the language
  203. named.
  204. .B \-c
  205. is the default.
  206. .I notangle
  207. ignores these options.
  208. .TP
  209. .B -w\fIn\fP
  210. When 
  211. .I nountangle
  212. transforms documentation chunks into comments, create comments on lines of width \fIn\fP.
  213. .I notangle
  214. ignores this option.
  215. .SH WEAVING
  216. <<man page: WEAVING section>>
  217. .SH INDEXING AND CROSS-REFERENCE
  218. <<man page: INDEXING AND CROSS-REFERENCE section>>
  219. When used with 
  220. .I LaTeX 
  221. or
  222. .I HTML,
  223. .I noweave
  224. can provide indexing and cross-reference information for chunks and for 
  225. programming-language identifiers.
  226. Identifier definitions may be marked by hand using \fB@ %def\fP, 
  227. or for some languages they may be found automatically using the 
  228. \fB-autodefs\fP option.
  229. This section describes the indexing and cross-reference options;
  230. it might well be skipped on first reading.
  231. <<noweave man page indexing options>>
  232. .SH ERROR MESSAGES
  233. If
  234. .I notangle
  235. or
  236. .I noweave
  237. encounters a chunk name within documentation, it assumes that this
  238. indicates an error, usually misspelling ``@<<name@>>=''.
  239. Other error messages should be self-explanatory.
  240. .PP
  241. It is incorrect to refer to a chunk that is never
  242. defined, but it is OK for chunks to be defined and not used.
  243. .SH FILES
  244. .PP
  245. .ta \w'|TEXINPUTS|nwkernel.texxxxx'u
  246. .nf
  247. |LIBDIR|/markup    markup preprocessor
  248. |LIBDIR|/unmarkup    inverts markup
  249. |LIBDIR|/nt    notangle proper
  250. |LIBDIR|/finduses    find uses of identifiers for index
  251. |LIBDIR|/noidx    generate index and cross-reference info
  252. |LIBDIR|/totex    back end to emit \fITeX\fP or \fILaTeX\fP
  253. |LIBDIR|/tohtml    back end to emit HTML
  254. |TEXINPUTS|/nwmac.tex    formatting \fITeX\fP macros
  255. |TEXINPUTS|/noweb.sty    use in \fILaTeX\fP documents; see \fInowebstyle(1)\fP
  256. .fi
  257. .SH SEE ALSO
  258. .PP
  259. .I cpif(1), nodefs(1), noroots(1), noweb(1), noindex(1), nowebstyle(1), nowebfilters(1)
  260. .SH BUGS
  261. .I notangle 
  262. and
  263. .I nountangle
  264. fail if names used on the command line contain single quotes.
  265. .PP
  266. Ignoring unused chunks can cause problems;
  267. if a chunk has
  268. multiple definitions and one is misspelled,
  269. the misspelled definition is silently ignored.
  270. .I noroots(1)
  271. can be used to catch this mistake.
  272. .PP
  273. .I noweb
  274. requires the new version of
  275. .I awk,
  276. assumed to be called
  277. .I nawk.
  278. DEC
  279. .I nawk
  280. has a bug in that that causes 
  281. .B noweave
  282. to fail to translate braces correctly.
  283. GNU 
  284. .I gawk
  285. is reported to work.
  286. .PP
  287. DEC 
  288. .I sh
  289. has a bug that causes the
  290. .B \-filter
  291. option to fail whenever the filter command contains more than one word.
  292. .PP
  293. <<paragraph about bogus latex pagestyles>>
  294. .PP
  295. .I latex2html(1)
  296. mangles some source files.
  297. .PP
  298. .I noweave
  299. has too many options, and this man page is too long.
  300. <<AUTHOR section>>
  301. <<description of -markup option>>=
  302. .TP
  303. .B "\-markup \fIparser\fP"
  304. Use 
  305. .I parser
  306. to parse the input file.
  307. Enables use of noweb tools on files in other formats;
  308. for example, the 
  309. .B numarkup
  310. parser understands
  311. .I nuweb(1)
  312. format.
  313. See 
  314. .I nowebfilters(1)
  315. for more information.
  316. For experts only.
  317. <<AUTHOR section>>=
  318. .SH AUTHOR
  319. Norman Ramsey, Bellcore.
  320. Internet address \fBnorman@bellcore.com\fP.
  321. .br
  322. Noweb home page at \fBftp://bellcore.com/pub/norman/www/noweb/intro.html\fP.
  323. <<paragraph about bogus latex pagestyles>>=
  324. The default
  325. .I LaTeX
  326. pagestyles don't set the width of the boxes containing headers and footers.
  327. Since 
  328. .I noweb
  329. code paragraphs are extra wide, this 
  330. .I LaTeX
  331. bug sometimes results in extra-wide headers and footers.
  332. The remedy is to redefine the relevant 
  333. .B ps@*
  334. commands;
  335. .B ps@noweb
  336. in 
  337. .B noweb.sty
  338. can be used as an example.
  339. @
  340. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  341. <<noweb.1>>=
  342. .TH NOWEB 1 "local <<noweb documentation date>>"
  343. .SH NAME
  344. noweb \- a simple literate-programming tool
  345. .SH SYNOPSIS
  346. .B noweb
  347. [\fB-t\fP] 
  348. [\fB-o\fP] 
  349. [\fB-L\fP\fIformat\fP] 
  350. [\fB-markup\fP \fIparser\fP]
  351. [file] ...
  352. .SH DESCRIPTION
  353. .I Noweb
  354. is a literate-programming tool like
  355. .I FunnelWEB
  356. or 
  357. .I nuweb,
  358. only simpler.
  359. .I noweb
  360. file contains program source code interleaved with documentation.
  361. When 
  362. .I noweb
  363. is invoked, it writes the program source code 
  364. to the output files mentioned in the noweb file, and it writes a 
  365. .I TeX
  366. file for typeset documentation.
  367. .PP
  368. For more flexibility, consider
  369. .I notangle(1)
  370. and 
  371. .I noweave(1).
  372. .SH FORMAT OF NOWEB FILES
  373. <<paragraph describing markup of chunks>>
  374. .PP
  375. Documentation chunks contain text that is copied verbatim to the
  376. .I TeX
  377. file (except for quoted code).
  378. .I noweb
  379. works with \fILaTeX\fP; the first documentation chunk must contain
  380. .I LaTeX
  381. .B "\\\\documentstyle"
  382. command with the 
  383. .B noweb
  384. document-style option.
  385. It must also contain a 
  386. .I LaTeX
  387. .B "\\\\begin{document}"
  388. command.
  389. .PP
  390. Code chunks contain program source code and references to other code
  391. chunks.
  392. Several code chunks may have the same name;
  393. .I noweb
  394. concatenates their definitions to produce a single chunk, just as
  395. other literate-programming tools do.
  396. .I noweb
  397. looks for chunks that are defined but not used in the source file.
  398. If the name of such a chunk contains no spaces, the chunk is
  399. an ``output file;''
  400. .I noweb
  401. expands it and writes the result onto the file of the same name.
  402. A code-chunk definition is like a macro definition;
  403. it contains references to other chunks, which are 
  404. themselves expanded, and so on.
  405. \fInoweb\fP's output is readable; it preserves the indentation of expanded
  406. chunks with respect to the chunks in which they appear.
  407. .PP
  408. If a star (\fB*\fP) is appended to the name of an output file,
  409. .I noweb
  410. includes line-number information as specified by the \fB-L\fP\fIformat\fP
  411. option (or for C if no \fB-L\fP\fIformat\fP option is given).
  412. The name itself may not contain shell metacharacters.
  413. .PP
  414. Code may be quoted within documentation
  415. chunks by placing double square brackets
  416. (\fB[[\fI...\fB]]\fR) around it.
  417. These double square brackets are used to
  418. give the code special typographic treatment in the
  419. .I TeX
  420. file.
  421. If quoted code ends with three or more square brackets,
  422. .I noweb
  423. chooses the rightmost pair, so that, for example, \fB[[a[i]]]\fR is
  424. parsed correctly.
  425. .PP
  426. <<paragraph on escaping angle brackets>>
  427. .PP
  428. <<paragraph on marking identifier definitions>>
  429. .SH OPTIONS
  430. .TP
  431. .B \-t
  432. Suppress generation of a 
  433. .I TeX
  434. file.
  435. .TP
  436. .B \-o
  437. Suppress generation of output files.
  438. .TP
  439. .B \-L\fIformat\fR
  440. Use 
  441. .I format
  442. to format line-number information for starred output files.
  443. (If the option is omitted, a format suitable for C is used.)
  444. .I format
  445. is as defined by 
  446. .I notangle(1);
  447. <<description of -markup option>>
  448. .SH BUGS
  449. .PP
  450. Ignoring unused chunks whose names contain spaces
  451. sometimes causes problems, especially in the case when a chunk has
  452. multiple definitions and one is misspelled;
  453. the misspelled definition will be silently ignored.
  454. .I noroots(1)
  455. can be used as a sanity checker to catch this sort of mistake.
  456. .PP
  457. .I noweb
  458. requires the new version of
  459. .I awk,
  460. assumed to be called
  461. .I nawk.
  462. DEC
  463. .I nawk
  464. has a bug in that that causes problems with braces in
  465. .I TeX
  466. output.
  467. GNU 
  468. .I gawk
  469. is reported to work.
  470. .PP
  471. <<paragraph about bogus latex pagestyles>>
  472. .SH SEE ALSO
  473. .PP
  474. .I "notangle(1), noweave(1), noroots(1), nountangle(1), nowebstyle(1),"
  475. .I "nowebfilters(1), nuweb2noweb(1)"
  476. .br
  477. Norman Ramsey,
  478. .I "Literate programming simplified, IEEE Software"
  479. 11(5):97-105, September 1994.
  480. <<AUTHOR section>>
  481. <<nowebstyle.1>>=
  482. .TH NOWEB 1 "local <<noweb documentation date>>"
  483. .SH NAME
  484. nowebstyle \- \fILaTeX\fP document-style option for \fInoweb\fP
  485. .SH SYNOPSIS
  486. .B "\\\\documentstyle[noweb,...]{...}"
  487. .SH DESCRIPTION
  488. When 
  489. .I noweave
  490. generates code for 
  491. .I LaTeX,
  492. the
  493. .B noweb
  494. document-style option is required.
  495. In addition to the necessary arcana, it
  496. defines a 
  497. .B webcode
  498. environment in which you can place fragments of 
  499. code, and in which
  500. only backslash and curly braces have their special meanings;
  501. all other characters are taken literally.
  502. It also defines a
  503. .B noweb
  504. pagestyle.
  505. Finally, it defines a
  506. .B "\\\\noweboptions{...}"
  507. command that can be used to tinker with the appearance of the output.
  508. Options are separated by commas and include:
  509. <<man page: [[\noweboptions]]>>
  510. .SH SEE ALSO
  511. .I noweave(1), noweb(1)
  512. .SH BUGS
  513. This man page has no business in section 1, but then it doesn't belong anywhere
  514. else, either.
  515. <<AUTHOR section>>
  516.